// axios基础的封装
import axios from "axios";

const httpInstance = axios.create({
    baseURL: 'http://pcapi-xiaotuxian-front-devtest.itheima.net',
    timeout:5000
})

// 拦截器
// 请求拦截器
httpInstance.interceptors.request.use(config => {
    // 拦截请求
    return config
}, e => Promise.reject(e))

// 响应拦截器
httpInstance.interceptors.response.use(res => {
    // 拦截响应
    return res.data
}, e => Promise.reject(e))

export default httpInstance;